Skip to content

Conversation

@dongowu
Copy link

@dongowu dongowu commented Aug 12, 2025

  • Add size-based adaptive search strategies

What type of PR is this?

Check the PR title.

  • This PR title match the format: <refactor>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
zh(optional):

Object::get方法引入了基于对象大小的智能优化策略

  1. ​​动态策略切换​​:根据对象规模自动选择linear、SIMD 、hash或cache
  2. 兼容性​​:完全向后兼容,无 API 变更
  3. ​​关键优化​​
    • 中对象采用 SIMD 加速字符串比对
    • 大对象启用全局缓存哈希表

(Optional) Which issue(s) this PR fixes:

Fixes #168

(optional) The PR that updates user documentation:

@CLAassistant
Copy link

CLAassistant commented Aug 12, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements multi-tier adaptive optimization for the Object::get method in a JSON processing library. The optimization introduces size-based adaptive search strategies that automatically select the most efficient lookup method based on object size.

  • Adds adaptive search strategies (linear, SIMD, hash-based) based on object size
  • Implements SIMD-accelerated string comparison for medium-sized objects
  • Introduces global hash index caching for large objects with LRU-like cleanup

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/value/object.rs Updates Object::get to use new optimized lookup method
src/value/node.rs Implements multi-tier adaptive optimization with linear, SIMD, and hash-based search strategies

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@PureWhiteWu
Copy link
Member

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!


@dongowu dongowu force-pushed the main branch 2 times, most recently from c60cac0 to 79d7955 Compare August 13, 2025 15:29
@liuq19
Copy link
Collaborator

liuq19 commented Sep 15, 2025

cloud you give more benchmarks to show the optimization

@liuq19
Copy link
Collaborator

liuq19 commented Sep 26, 2025

thanks, cloud you provide the benchmark results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Optimize Object::get

4 participants